﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="sms_money_data.aspx.vb" Inherits="webfinancegdrassign4.sms_money_data" %>


<%--Smart Money $aver Project for University of Herts--%>
<%--Date: 01 December 2013--%>
<%--Version 1--%>
<%--Project Brief Description - This is a Smart Money Saver asp.net product using VB.net. It is intended to be used by Smart Money Savers who want to make and save money and earn and save a certain amount to benefit--%>
<%--Program Brief Description - This is the main Site.Master file. All change appear on all pages. This is a standard program from a default build from setting up the project in Visual Studio --%>
<%--Changes - Added an image for the Smart Investor program / website --%>
<%--Changes - Changed original Texts to 'Smart Money $aver ' --%>

<%--Update 1 -  5th Jan 2014 - sms_info_contact_info.aspx enabled page to allow admin user to update,delete and select data from Table --%>


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script type="text/javascript">
        function newPopup1(url) {
            popupWindow = window.open(
            url, 'popUpWindow', 'height=550,width=820,left=200,top=20,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')
        }
    </script>
    <style>
        .classrd {
        }

        .frm-rght-clr123 RadioButton lable {
        }

        .frm-rght-clr123 label {
            margin-top: -14px;
            display: block;
            margin-bottom: 5px;
        }

        .frm-rght-clr123 RadioButton, input, textarea, .uneditable-input {
            width: 120px;
        }
    </style>

    <asp:UpdatePanel ID="MyUpdatePanel" runat="server">
        <ContentTemplate>


            <div class="hero-unit">

                <div class="row-fluid">
                    <div id='cssmenu'>
                        <ul>
                            <li><a href="sms_comments.aspx"><span>Comments</span></a></li>
                            <li><a href="sms_info_about.aspx"><span>Info About</span></a></li>
                            <li class='active'><a href="sms_money_data.aspx"><span>Money Data</span></a></li>
                            <li><a href="sms_moneyjunction.aspx"><span>Money Junction</span></a></li>
                            <li><a href="sms_moneytype.aspx"><span>Money Type</span></a></li>
                            <li><a href="sms_tags.aspx"><span>Tags</span></a></li>
                            <li><a href="sms_type.aspx"><span>User Type</span></a></li>
                        </ul>
                    </div>
                    <div style="margin-top: 10px;">

                        <%--<input type="button" value="Add Comments" class="button" style="float: right; width: 116px;" onclick="return window.open('AddComment.aspx', 'mywindow', 'menubar=1,resizable=1,width=650,height=400,top=100,left=400');" />--%>
                    </div>
                </div>
                <hgroup></hgroup>

                <h2 style="color: #999;">Edit Money Information
                    <asp:Button runat="server" ID="btnAddComments" Text="Add Sms Money Data" CssClass="button" Style="float: right; width: 150px;" OnClientClick="JavaScript:newPopup1('AddMoneyData.aspx');" /></h2>

                <div class="head-2">

                    <asp:GridView ID="GridView1" runat="server" PageSize="8" CssClass="Grid" Width="100%" DataSourceID="SqlDataSource005" AutoGenerateColumns="False" DataKeyNames="ID" AllowPaging="True" AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None" OnRowEditing="GridView1_RowEditing" OnRowDeleting="GridView1_RowDeleting" OnPageIndexChanging="GridView1_PageIndexChanging">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <itemstyle width="10%" />
                                    <asp:ImageButton ID="imgdelete" runat="server" CommandName="Delete" ToolTip="Delete" CausesValidation="false" Width="25" ImageUrl="~/img/Delete.png" OnClientClick="return confirm('Do you want to Delete this Recored')" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:ImageButton ID="imgEdit" runat="server" CommandName="Edit" ToolTip="Edit" CausesValidation="false" Width="25" ImageUrl="~/img/1leftarrow.png" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField Visible="false">
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "ID")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Money Type">
                                <ItemStyle Width="" />
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "moneytype_fkid")%>
                                </ItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Money SubType">
                                <ItemStyle Width="" />
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "moneytype_fkid")%>
                                </ItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Company_Name">
                                <ItemStyle Width="" />
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "Company_Name")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Stars">
                                <ItemStyle Width="" />
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "Stars")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Description">
                                <ItemStyle Width="" />
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "Description")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="ContactDetails">
                                <ItemStyle Width="" />
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "Contact_Details")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="companyurl">
                                <ItemStyle Width="" />
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "companyurl")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Picture">
                                <ItemStyle Width="" />
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "Picture")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>

                        <EditRowStyle BackColor="#FFFF99" />

                        <FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle HorizontalAlign="Left" />
                        <RowStyle BackColor="#EFF3FB" />

                        <SelectedRowStyle Font-Bold="True" ForeColor="#FFFF99" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />



                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSource005" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString006 %>" ProviderName="<%$ ConnectionStrings:ConnectionString006.ProviderName %>" SelectCommand="SELECT sms_moneydata.ID, sms_moneydata.Company_Name, sms_moneydata.Location, sms_moneydata.Stars, sms_moneydata.Description,sms_moneydata.Contact_Details, sms_moneydata.Picture, sms_moneydata.companyurl, sms_moneytype.moneytype AS moneytype_fkid, 
                         sms_moneysubtype.moneysubtype_name AS moneysubtype_fkid FROM   ((sms_moneysubtype INNER JOIN  sms_moneydata ON sms_moneysubtype.ID = sms_moneydata.moneysubtype_fkid) INNER JOIN  sms_moneytype ON sms_moneydata.moneytype_fkid = sms_moneytype.ID) order by sms_moneydata.ID Desc" OldValuesParameterFormatString="original_{0}"></asp:SqlDataSource>
                </div>



                <div class="row-fluid" style="border: 0px none none">
                    <script type="text/javascript">
                        function GetFile() {
                            var fileinput = document.getElementById('<%=fl1.ClientID%>');
                            var textinput = document.getElementById('<%=txtfl1.ClientID%>');
                            textinput.value = fileinput.value;
                        }
                    </script>
                    <asp:HiddenField ID="hdnId" runat="server" />
                    <table class="table" style="border: 0px none none">
                        <tr>
                            <th colspan="5" class="td-head"><span class="spanhead">Edit Record
                                <asp:Button ID="Button1" runat="server" Text="Edit" CssClass="button" Style="width: 70px; margin-left: 50px;" OnClick="Button1_Click1" ValidationGroup="add" />&nbsp;<asp:Button ID="btncancel" runat="server" Text="Cancel" Width="80" CssClass="button" OnClick="btncancel_Click" />&nbsp;<asp:Button ID="Button2" runat="server" Height="36px" Width="156px" Text="Return to Main Menu" PostBackUrl="~/Account/Admininput.aspx" CssClass="button" /></span></th>
                        </tr>
                        <tr>
                            <td class="frm-lft-clr123">
                                <asp:Label ID="Label9" runat="server" Text="Money Type Id"></asp:Label></td>
                            <td class="frm-rght-clr123">
                                <asp:DropDownList ID="ddl_moneytype" runat="server" DataSourceID="SqlDataSource007" DataTextField="moneytype" DataValueField="ID" Width="80px">
                                </asp:DropDownList>
                                <asp:SqlDataSource ID="SqlDataSource007" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString07 %>" ProviderName="<%$ ConnectionStrings:ConnectionString07.ProviderName %>" SelectCommand="SELECT [ID], [moneytype] FROM [sms_moneytype]"></asp:SqlDataSource>

                            </td>
                            <td class="frm-lft-clr123">
                                <asp:Label ID="Label2" runat="server" Text="Money Sub Type Id"></asp:Label></td>
                            <td class="frm-rght-clr123">
                                <asp:DropDownList ID="ddl_submoney" runat="server" DataSourceID="SqlDataSource08" DataTextField="moneysubtype_name" DataValueField="ID">
                                </asp:DropDownList>
                                <asp:SqlDataSource ID="SqlDataSource08" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString004 %>" ProviderName="<%$ ConnectionStrings:ConnectionString004.ProviderName %>" SelectCommand="SELECT [moneysubtype_name], [ID] FROM [sms_moneysubtype]"></asp:SqlDataSource>
                            </td>
                        </tr>
                        <tr>
                            <td class="frm-lft-clr123">
                                <asp:Label ID="Label11" runat="server" Text="Company Name"></asp:Label></td>
                            <td class="frm-rght-clr123">
                                <asp:TextBox ID="company_name" runat="server" CssClass="textbox" Width="200"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="company_name"
                                    CssClass="text-error" ValidationGroup="add" ErrorMessage='<img src="../img/error1.gif" alt="" />' ToolTip="The Company name field is required." /></td>
                            <td class="frm-lft-clr123">
                                <asp:Label ID="Label13" runat="server" Text="Location:"></asp:Label></td>
                            <td class="frm-rght-clr123">
                                <asp:TextBox ID="location" runat="server" CssClass="textbox" Width="200"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="location"
                                    CssClass="text-error" ValidationGroup="add" ErrorMessage='<img src="../img/error1.gif" alt="" />' ToolTip="The Location field is required." />


                            </td>
                        </tr>
                        <tr>
                            <td class="frm-lft-clr123">
                                <asp:Label ID="Label3" runat="server" Text="Stars"></asp:Label></td>
                            <td class="frm-rght-clr123" style="border: 0px none none; padding: 10px; margin: 0px">
                                <asp:RadioButton ID="RadioButton1" Checked="true" runat="server" CssClass="classrd" GroupName="Star" Text="Star1" Style="border: 0px none none; padding: 0px; margin: 0px; float: left" />
                                <asp:RadioButton ID="RadioButton2" runat="server" CssClass="classrd" GroupName="Star" Text="Star2" Style="border: 0px none none; padding: 0px; margin: 0px;" />
                                <asp:RadioButton ID="RadioButton3" runat="server" CssClass="classrd" GroupName="Star" Text="Star3" Style="border: 0px none none; padding: 0px; margin: 0px; float: left" />
                                <asp:RadioButton ID="RadioButton4" runat="server" CssClass="classrd" GroupName="Star" Text="Star4" Style="border: 0px none none; padding: 0px; margin: 0px;" />
                                <asp:RadioButton ID="RadioButton5" runat="server" CssClass="classrd" GroupName="Star" Text="Star5" Style="border: 0px none none; padding: 0px; margin: 0px" />

                                <asp:Label ID="lblError" runat="server"></asp:Label>
                            </td>





                            <td class="frm-lft-clr123">
                                <asp:Label ID="Label4" runat="server" Text=" Description"></asp:Label></td>
                            <td class="frm-rght-clr123">
                                <asp:TextBox ID="txt_desc" runat="server" CssClass="textarea" TextMode="MultiLine" Rows="3" Width="200"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txt_desc"
                                    CssClass="text-error" ValidationGroup="add" ErrorMessage='<img src="../img/error1.gif" alt="" />' ToolTip="The Description field is required." />

                            </td>
                        </tr>

                        <tr>
                            <td class="frm-lft-clr123">
                                <asp:Label ID="Label5" runat="server" Text="Contact Details"></asp:Label></td>
                            <td class="frm-rght-clr123">
                                <asp:TextBox ID="contact_details" runat="server" CssClass="textbox" Width="200"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="contact_details"
                                    CssClass="text-error" ValidationGroup="add" ErrorMessage='<img src="../img/error1.gif" alt="" />' ToolTip="The Contact field is required." />
                            </td>
                            <td class="frm-lft-clr123">
                                <asp:Label ID="Label6" runat="server" Text="Company URL"></asp:Label></td>
                            <td class="frm-rght-clr123">
                                <asp:TextBox ID="company_url" runat="server" CssClass="textbox" Width="200"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="company_url"
                                    CssClass="text-error" ValidationGroup="add" ErrorMessage='<img src="../img/error1.gif" alt="" />' ToolTip="The Company URL field is required." />

                            </td>
                        </tr>
                        <tr>
                            <td class="frm-lft-clr123">
                                <asp:Label ID="Label7" runat="server" Text="Picture"></asp:Label></td>
                            <td class="frm-rght-clr123">
                                <asp:Label ID="lbl_pic" runat="server"></asp:Label>
                                <asp:TextBox ID="txtfl1" CssClass="textbox" Enabled="false" runat="server"></asp:TextBox>
                                <div class="fileUpload btn btn-primary" id="divfl1" runat="server">
                                    <span style="margin: 0; padding: 0; border: 0; font-size: 100%; vertical-align: baseline;">Upload</span>
                                    <asp:FileUpload ID="fl1" runat="server" Width="50" CssClass="upload" onchange="return GetFile()" />

                                </div>

                            </td>

                        </tr>
                    </table>
                </div>
            </div>
        </ContentTemplate>
          <Triggers>
                <asp:PostBackTrigger ControlID="Button1"  />
            <asp:PostBackTrigger ControlID="GridView1" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
